package ooday01;
//学生类
public class Student {//自己创造的一种数据类型
    //成员变量---描述对象的属性
    String name;
    int age;
    String className;
    String stuId;
    //构造方法
    Student(){
    }
    Student(String name,int age,String className,String stuId){
        this.name = name;
        this.age = age;
        this.className = className;
        this.stuId =stuId;
    }
    void study(){
        System.out.println(name+"正在学习...");
    }
    void sayHi(){
        System.out.println("大家好,我叫"+name+",今年"+age+"岁了,所在班级是"
                +className+"学号是:"+stuId);
    }
    void playWith(String anotherName){
        System.out.println(name+"正在和"+anotherName+"一起玩耍");
    }




  /* Student(String name1,int age1,String className1,String stuId1){
       this.name = name1;           //张三
       this.age =age1;             //25
       this.className = className1;//jsd2312
       this.stuId = stuId1;       //001
   }*/
    //方法----描述对象的行为
   /* void study(){//          zg.name
        System.out.println(this.name+"正在学习...");
    }
    void sayHi(){//                      zg.name          zg.age
        System.out.println("大家好,我叫"+this.name+",今年"+this.age+"岁了,所在班级是"
                 //           zg.className            zg.stuId
                           +this.className+"学号是:"+this.stuId);
    }
    void playWith(String anotherName){
               //            zg.name
        System.out.println(this.name+"正在和"+anotherName+"一起玩耍");
    }*/
}

